﻿using DotNet.Data;
using DotNet.Utility;
using XNWebModel;

namespace XNWebService
{
    public class RegProtocolService
    {
        private static readonly Repository<RegProtocol> dao = new Repository<RegProtocol>(new SiteDatabase());


        /// <summary>
        /// 通过标题id查找对应注册协议数据
        /// </summary>
        /// <param name="title">标题id</param>
        /// <returns></returns>
        public static BoolMessage<RegProtocol> GetRegProtocol(string  titleId)
        {
            titleId = titleId.Trim();
            var model = dao.Get(p => p.TitleId== titleId);
            if (model == null)
            {
                return new BoolMessage<RegProtocol>(false, "未查到对应注册协议数据！");
            }

            return new BoolMessage<RegProtocol>(model);
        }

    }
}
